package com.moreemrecife.jpa;

import java.io.Serializable;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;


/**
 * The persistent class for the group database table.
 */
@Entity
@Table(name="GROUP")
public class Group implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name="GROUPID")
	private int id;

	@Column(name="GRP_NAME")
	private String name;

    @Column(name="GRP_DESCRIPTION")
    private String description;

    @OneToMany(fetch=FetchType.LAZY)
	@JoinColumn(name="GROUPID")
	private Set<GroupFunction> functions;

    public Group() {
    }

	public int getId() {
		return this.id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Set<GroupFunction> getFunctions() {
		return functions;
	}

	public void setFunctions(Set<GroupFunction> functions) {
		this.functions = functions;
	}

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }
}